package interceptor;

import listener.ResultListener;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

/**
 * @author dingyuanwei
 * @version 建立時間：Dec 24, 20103:26:56 PM
 * 類別說明:拦截结果拦截器
 */
public class ResultInterceptor extends AbstractInterceptor {
	@Override
	public String intercept(ActionInvocation ai) throws Exception {
		ai.addPreResultListener(new ResultListener());
		System.out.println("exectue()方法执行之前");
		String result = ai.invoke();
		System.out.println("exectue()方法执行之后");
		return result;
	}
}
